﻿@using ExcellOnServices.Models;
@model PagedList.IPagedList<Product>
@using PagedList.Mvc;

@{	
	ViewBag.Title = "Online Store";
	ViewBag.Active = "Store";

	int categoryId = ViewBag.categoryId;
	List<Category> categories = ViewBag.categories;
}

<!-- .content -->
<div class="content content-info">
	<div class="container">

		<div class="row">

			<div class="col-md-3 bs-docs-sidebar" id="sidebar">
				<ul class="nav nav-pills nav-stacked bs-docs-sidenav affix-top" data-spy="affix" data-offset-top="130">
					<li class="nav-header disabled"><a><span class="glyphicon glyphicon-shopping-cart"></span>&nbsp;&nbsp;Categories</a></li>
					@if (categoryId == 0) { 
							@:<li class="active">
					} else {
							@:<li>
					}
					<a href="@Url.Action("Index", "Store", null)">All Products</a>
					</li>

					@foreach (ExcellOnServices.Models.Category cat in categories) {
						if (categoryId == cat.Id) { 
							@:<li class="active">
						} else {
							@:<li>
						}
						<a href="@Url.Action("Index", "Store", new { categoryId = @cat.Id })">@cat.Name</a>
						@:</li>
					}
					<li class="nav-header disabled"><a><span class="glyphicon glyphicon-comment"></span>&nbsp;&nbsp;Get in touch</a></li>
					<li><a>Hotline: 1-800-000-000</a></li>
					<li><a href="mailto:excellonservices@email.com">Send us Email</a></li>
					<li><a href="skype:excellonservices?chat">Chat on Skype</a></li>
				</ul>
			</div>
			<!--/ .sidebar -->

			<div class="col-md-9">
				<div class="page-header">
					<h1 id="overview">Online Store <small>Lorem ipsum dolor sit amet</small></h1>
				</div>

				@Html.Partial("_PartialProductList", Model.ToList())

				<div class="text-center">
					@Html.PagedListPager(Model, page => Url.Action("Index", new { page, search = ViewBag.search, categoryId = ViewBag.categoryId }))
				</div>

			</div>
		</div>
		<!--/ .row -->

	</div>
	<!--/ .container -->
</div>
<!--/ .content -->
